<%-- 
    Document   : editworkProject
    Created on : Jul 28, 2012, 10:42:22 AM
    Author     : VANANH
--%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="../css/popup.css"/>
        <link rel="stylesheet" type="text/css" href="../css/kapiform.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>  
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.rateit.js"></script>

        <link rel="stylesheet" type="text/css" href="../css/rateit.css">
    </head>
    <script type="text/javascript">
        var open_cur = 0;
        $j = jQuery.noConflict();
        var fn750=0;
        
        $j(document).ready(function(){
            $j('.keysearchCountry').live('keyup',function(){
                $j('.greyRow1').addClass("acive");
                $j('.whiteRow1').addClass("acive");
                    if($j('.keysearchCountry').val() == ""){
                        $j('.acive').show();
                                   
                    }else{
                        $j('.acive').hide();
                        $j('.acive').each(function(){
                            html = $j(this).html();
                            if(   ununicode(html).indexOf(  ununicode($j('.keysearchCountry').val()) ) > -1    )  {
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                });
                $j('.keysearch11').live('keyup',function(){
                $j('.greyRow2').addClass("acive1");
                $j('.whiteRow2').addClass("acive1");
                    if($j('.keysearch11').val() == ""){
                        $j('.acive1').show();
                                   
                    }else{
                        $j('.acive1').hide();
                        $j('.acive1').each(function(){
                            html = $j(this).html();
                            if(   ununicode(html).indexOf(  ununicode($j('.keysearch11').val()) ) > -1    )  {
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                });
            
            $j(".choose1").live("click",function(){
                fn750 = $j(this).attr('lang');
                fk100 = '<c:out value="${v300Controller.fk100}"/>';
                $j('input[lang!='+fn750+'].choose1').attr('checked',false); 
                if($j(this).is(':checked')){
                    $j.post("actionCountry.jsp?action=getidCountry&fn750="+ fn750+"&fk100="+fk100,function(data){
                        if(data!=null){
                            $j(".tableCity").html(data);   
                        }
                        
                    });
                }else{
                    $j.post("actionCountry.jsp?action=getidCountry&fn750="+ fn750,function(data){
                        if(data!=null){
                            $j(".tableCity").html(null); 
                        }
                        
                    });
                }
            });
           
            $j(".choose2").live("click",function(){
           
                fv200t = '<c:out value="${v300Controller.fv200}"/>';
                price = '<c:out value="${v300Controller.vn302}"/>';
                fk100 = '<c:out value="${v300Controller.fk100}"/>';
                vv301 = '<c:out value="${v300Controller.vv301}"/>';
                vv304  = '<c:out value="${v300Controller.vv304}"/>';
                vv305  = '<c:out value="${v300Controller.vv305}"/>';
                $j(".mesage").text("");
                $j(".choose2").attr('disabled',false);
                fa000 = $j(this).attr('lang');
                // $j('input[lang!='+fa000+'].choose2').attr('checked',false); 
                if($j(this).is(':checked')){
                    $j.post("cityaction.jsp?action=getidcity&fa000="+ fa000+"&fv200="+fv200t+"&fn750="+fn750+"&vn302="+price+"&fk100="+fk100+"&vv301="+vv301+"&vv304="+vv304+"&vv305="+vv305,function(data){
                        if(data!=null){
                            $j(".mesage").text("Cập nhật thành công!");
                            hidePleaseWait();
                        }
                    });
                }
                $j(this).attr('disabled',true);
            });
              
        });

    </script>
    <style type="text/css">

        #ui-datepicker-div
        {
            z-index: 9999999;
        }
        html{visible : true}

        .bg_department{
            height: 68px !important;
        }

        .feild_sex tr td {
            float:left !important;
            width: 80px !important; 
            height: 20px;

        }
        .feild_sex tr td label {
            text-align: center !important;
            width: 88px !important; 
            color: black;
            margin-top: 20px;
            font-size: 12px;
            margin-left: -55px;
        }
        .feild_sex tr td input[type="radio"]{
            float:left !important;

        }
        .ui-datepicker-trigger1{
            cursor: pointer;
            position: absolute;
        }
        .itemimg{
            float:left;
            margin-top: -5px;
            width: 50%;

        }
        .field_normal{            
            width:100%; 
        }
        .field_pink{
            background-color: #D1E1F1; 

        }
        .lbl_editWork{
            float: left !important;
            width: 115px !important;
            /*  text-align:right !important;
              
              width: 95px !important;
              padding-top: 10px!important;
              padding-bottom: 0px; */

        }

        .date_editWork{
            width: 250px;
            float: left;
            margin-top: 8px;
        }
        img.ui-datepicker-trigger{
            margin-top: 3px !important;
        }
        .priority_work{
            width:370px;

            float:left;
            color: black;
        }
        .div_null{
            width: 290px;
            height: 20px;
            float: left;
        }
        .select{
            width: 200px !important;
        }
        .message{
            color: red;
            float: left;
            margin-left: 263px;
            margin-top: 13px;
            text-align: center;

        }
        .tabelCountry{
            float: left;
            height: 373px;
            margin-left: 10px;
            margin-top: 3px;
            overflow-y: scroll;
            width: 96%;
        }
        .choose{
            width:15px;text-align: center;
            margin-left: 5px;
        }
        .tableCity{
            margin-left: 20px;
            width: 300px;
            border: 1px solid #B2B7BB;
            float: left;
            height: 415px
        }
        .whiteRow1{
            background-color: white;
        }
        .greyRow2{
             background: #E0EFFC;
        }
        .whiteRow2{
            background-color: white;
        }
        
  
    </style>
    <f:view>
        <a4j:form id="form-input-customer" >
            <body style=" float:left; width:auto; height:auto; margin:0px;">
                <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
                <div class="popup" style="height:569px; width:670px">
                    <div class="popup-header">
                        <div class="title"><h:outputText value="Quốc gia"/></div>

                    </div>
                    <div class="popup-content">

                        <div class="main_content">
                            <div class="form_item_content" style="margin-top:15px; margin-left: 0px" >
                                <div class="item_content" style="display:block">

                                    <div style="margin-left: 20px;width: 305px;border: 1px solid #B2B7BB;float: left;height: 415px">
                                        <div style="float: left"> 
                                            <div class="search_char" style="margin-left: 52px;float:left;height: 30px;padding: 8px 0px 0px 10px;">
                                                <h:inputText value="#{k400Controller.keysearch}" onfocus="if(this.value=='#{k400Controller.keysearch}')this.value='';" styleClass="keysearchCountry"  style="width:197px,margin-left:33px;"/>
                                                <h:commandButton      action="#{k400Controller.reload}" value="" style="margin-left:5px;" styleClass="buttonsearch">
                                                </h:commandButton>
                                            </div>
                                        </div>

                                        <div class="tabelCountry">
                                            <rich:dataTable  reRender="sc2" value="#{v300Controller.listCountAll}" var="item"                            
                                                             rowClasses="greyRow1, whiteRow1"
                                                             columnClasses=",columns,columns,columns" rowKeyVar="row"
                                                             id="table" styleClass="machinePosDataTable">
                                                <rich:column style="width:15px;">
                                                    <f:facet name="header">
                                                        <h:outputText value="Chọn" />
                                                    </f:facet>

                                                    <div class="choose" style="width: 15px;text-align: center" lang="<h:outputText value="#{item.pn750}"/>">
                                                        <h:selectBooleanCheckbox lang="#{item.val}" styleClass="choose1" id="check" value="">
                                                        </h:selectBooleanCheckbox>


                                                    </div>
                                                </rich:column>
                                                <rich:column >
                                                    <f:facet name="header">
                                                        <h:outputText value="Quốc gia" />
                                                    </f:facet>

                                                    <div style="text-align: left">
                                                        <h:outputText value="#{item.label} " /> 
                                                    </div>
                                                </rich:column>
                                                    <rich:column style="width: 20px;" >
                                                    <f:facet name="header">
                                                        <h:outputText value="Trạng thái" />
                                                    </f:facet>

                                                    <div style="width: 49px;text-align: center">
                                                        <h:panelGroup rendered="#{item.selected==true}"><img height="15px;" width="15px;" src="../images/camera_test.png" /></h:panelGroup>   
                                                    </div>
                                                </rich:column>

                                            </rich:dataTable>
                                        </div>

                                    </div>
                                    <div class="tableCity">

                                    </div>
                                                <div class="mesage"></div>

                                </div>   
                            </div>
                        </div>

                        <div class="popup-footer" >
                            
                            <div class="buttonsave close111" style="margin-right: 35px;" onclick="parent.jQuery.fancybox.close(); "  ><span><h:outputText value="#{locale.button_close}"/></span></div>
                            <h:inputHidden value="#{v300Controller.fk100}" id="fk100"/> 
                        </div>

                    </div>          
            </body>
        </a4j:form>
    </f:view>
</html>
<script type="text/javascript">
    $j(document).ready(function(){
        yhight = ($j('.popup').height()-90)+"px" ;
        $j('.main_content').css('height',yhight );
        $j('.popup-content').css('height',yhight );
        
        
    });
</script>

